1. Field of the Invention
The present invention relates to a disk storage apparatus in which an arbitrary sector in an alternate area on a disk is allocated as an alternate sector for a defective sector on the disk. Particularly, it relates to an apparatus and method for accessing a disk containing an alternate sector, which enable high speed disk access even if the disk access range designated in a read/write request from a host contains a defective sector, making it necessary to access an alternate sector allocated to the defective sector.
2. Description of the Related Art
In general, in disk storage apparatuses, represented by hard disk drives (magnetic disk drives), alternate sector processing is performed on defective sectors of a disk. A defective sector is on in which an error has occurred a predetermined number of times during disk access. “Alternate sector processing” means the allocation of another sector on the disk in place of the defective sector. The sector allocated to the defective sector is called an alternate sector. The track containing the alternate sector is called an alternate track. Alternate tracks are provided in a special area (alternate area) on the disk, which differs from normal tracks.
In disk storage apparatuses, disk access is performed in accordance with a read/write command (disk access command) supplied from a host. In the case that a defective sector, to which an alternate sector is allocated, is found in the disk access range designated by the read/write command, both a normal track and alternate track are accessed. The alternate track is secured in an area different from that of normal tracks that contain the defective sector. Accordingly, to access the alternate sector, it is necessary to perform a so-called seek operation for moving a head from the normal track, containing the defective sector to which the alternate sector is allocated, to the track (alternate track) containing the alternate sector.
Disk access processing, performed when a seek operation for moving a head from a normal track to an alternate track is necessary, is executed in the following manner. Firstly, when a defective sector is accessed during accessing a normal track, disk access is temporarily stopped. In this state, a seek operation for moving the head to the alternate track containing the alternate sector is performed. After the seek operation is finished, the alternate sector is accessed. After the access to the alternate sector normally finishes, disk access is temporarily stopped to re-access the normal track. In this state, a seek operation for moving the head from the alternate track back to the normal track is performed.
Thus, if a defective sector is found in the disk access range designated by a read/write command from a host, a seek operation for moving the head from the track (normal track) containing the defective sector to the track containing the alternate sector allocated to the defective sector is performed. Therefore, even if the positional relationship between the defective sector and alternate sector is optimally set, at least the time corresponding to one rotation of the disk is necessary until the alternate sector is accessed after the start of the seek operation. Similarly, at least the time corresponding to one rotation of the disk is necessary until the sector following the defective sector is accessed after the start of the seek operation for moving the head from the alternate track to the normal track. If the positional relationship between the defective sector and alternate sector cannot be set optimally, the time corresponding to several rotations of the disk is necessary until the head is moved from the normal track to the alternate track to access the alternate sector. Similarly, the time corresponding to several rotations of the disk is necessary until the head is returned from the alternate track to the normal track to access the sector following the defective sector. In other words, the disk access performance, including the access to an alternate sector, depends upon the positional relationship between defective and alternate sectors. A series of disk access operations including access to an alternate sector will be referred to as “alternate sector access”.
Jpn. Pat. Appln. KOKAI Publication No. 1-166378 discloses a method (this will hereinafter be referred to as a “first alternate sector access method”), in which if writing of data to a disk area containing a defective sector is requested by a host, the data to be written to the defective sector is once written to a memory. The data in the memory is copied to an arbitrary alternate sector after disk access requested by the host finishes. Further, if reading of data from a disk area that contains a defective sector is requested by the host, the data written in the corresponding alternate sector (i.e. the data in the alternate sector) is once copied to the memory. To read this data, the memory is accessed instead of accessing the alternate sector corresponding to the defective sector. As a result, the data from the alternate sector, copied to the memory, is read.
As described above, in the first alternate sector access method, the data stored in each alternate sector is loaded to a memory. In this case, if a host has issued a request to access a disk, actual access is made to normal tracks, whereas, concerning alternate sectors, data is copied from the memory instead of accessing them. This can dispense with the operation of seeking alternate tracks. Accordingly, in the first alternate sector access method, the time required for accessing each alternate sector can be made constant regardless of the positional relationship between the defective sector and corresponding alternate sector.
However, in the first alternate sector access method, accessing a disk and copying of data from the memory cannot be performed simultaneously. Therefore, if a defective sector is found during disk access, it is necessary to temporarily stop disk access, then copy data from the memory, and resume disk access. In short, the first alternate sector access method cannot realize the same access performance as normal disk access.
Jpn. Pat. Appln. KOKAI Publication No. 4-162127 discloses a method (this will hereinafter be referred to as a “second alternate sector access method”), which is similar to the above first alternate sector access method. The second alternate sector access method is characterized in that, even if a normal track contains a larger number of defective sectors than preparatory sectors provided in the track, the track is not considered defective as long as it satisfies a predetermined condition. The predetermined condition is that the number of defective sectors does not exceed a predetermined number K (K≧the number of preparatory sectors provided for each track). In this case, alternate sectors on each alternate track are allocated only to the defective sectors that are obtained by subtracting the preparatory sectors for each track from all defective sectors on each track, thereby reducing the memory capacity required for alternate sectors. However, also in the second alternate sector access method, no consideration is given to realization of the same access performance as in normal disk access.
Jpn. Pat. Appln. KOKAI Publication No. 5-182369 discloses a method (this will hereinafter be referred to as “third alternate sector access method”), which is similar to the above-described first alternate sector access method. The third alternate sector access method is characterized in that the data written in each alternate sector on a disk (i.e. the data in each alternate sector) is copied to a memory when the disk storage apparatus is turned on. In this case, when it is necessary to write data to an alternate sector, the data is written to both the alternate sector and the memory. Further, if it is necessary to read data from an alternate sector, the data is read from the memory, but not from the alternate sector. Also in the third alternate sector access method, no consideration is given to realization of the same access performance as in normal disk access.